package com.sxy;

import com.sxy.config.SpringConfig;
import com.sxy.pojo.Brand;
import com.sxy.service.BrandService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

/**
 * @author 宋鑫宇
 * @version 1.0
 */
public class App {
    public static void main(String[] args) {
        //通过AnnotationConfigApplicationContext类来获取ioc容器
        ApplicationContext c = new AnnotationConfigApplicationContext(SpringConfig.class);
        //获取bean
        BrandService brandService = c.getBean(BrandService.class);
        //执行查询方法
        Brand brand = brandService.selectById(10);

        System.out.println(brand);
    }
}
